package models.domain;

import models.data.Heimavinna;
import models.data.Stundatoflur_NK;
import org.omg.CORBA.PRIVATE_MEMBER;
import play.data.validation.Constraints;

import javax.persistence.Id;
import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: olgak
 * Date: 3.5.2013
 * Time: 10:47
 * To change this template use File | Settings | File Templates.
 */
public class TimetableHomework {
    private int id;
    private String dagur;
    private String hopur_id;
    /*TIMESLOT
        1=8:30-9:15
        2=9:20-10:05
        3=10:20-11:05
        4=11:10-11:55
        5=12:20-13:05
        6=13:10-13:55
        7=14:00-14:45
        8=14:55-15:40
     */
    private Integer timeslot;
    private String kennari_upphafsstafir; //Initials of teacher
    private String stofa;
    private String afangi_id;
    private String namsgrein_afanganr;
    private String heimavinnaTexti;

    public String getDagur() {
        return dagur;
    }

    public void setDagur(String dagur) {
        this.dagur = dagur;
    }

    public String getHopur_id() {
        return hopur_id;
    }

    public void setHopur_id(String hopur_id) {
        this.hopur_id = hopur_id;
    }

    public Integer getTimeslot() {
        return timeslot;
    }

    public void setTimeslot(Integer timeslot) {
        this.timeslot = timeslot;
    }

    public String getKennari_upphafsstafir() {
        return kennari_upphafsstafir;
    }

    public void setKennari_upphafsstafir(String kennari_upphafsstafir) {
        this.kennari_upphafsstafir = kennari_upphafsstafir;
    }

    public String getStofa() {
        return stofa;
    }

    public void setStofa(String stofa) {
        this.stofa = stofa;
    }

    public String getAfangi_id() {
        return afangi_id;
    }

    public void setAfangi_id(String afangi_id) {
        this.afangi_id = afangi_id;
    }

    public String getNamsgrein_afanganr() {
        return namsgrein_afanganr;
    }

    public void setNamsgrein_afanganr(String namsgrein_afanganr) {
        this.namsgrein_afanganr = namsgrein_afanganr;
    }

    public String getHeimavinnaTexti() {
        return heimavinnaTexti;
    }

    public void setHeimavinnaTexti(String heimavinnaTexti) {
        this.heimavinnaTexti = heimavinnaTexti;
    }

    public int getId() {
        return id;
    }

    public void setHeimavinnaTexti(int id) {
        this.id = id;
    }

    public TimetableHomework(int id,String dagur, String hopur_id, Integer timeslot, String stofa, String kennari_upphafsstafir, String afangi_id, String namsgrein_afanganr,String heimavinnaTexti) {
        this.id = id;
        this.dagur = dagur;
        this.hopur_id = hopur_id;
        this.timeslot = timeslot;
        this.stofa = stofa;
        this.kennari_upphafsstafir = kennari_upphafsstafir;
        this.afangi_id = afangi_id;
        this.namsgrein_afanganr = namsgrein_afanganr;
        this.heimavinnaTexti = heimavinnaTexti;
    }

    public TimetableHomework(){

    }


    public static List<TimetableHomework> makeTimetableHomework(List<List<Stundatoflur_NK>> stundatofluDagar, List<List<Heimavinna>> HeimavinnaDagar){
        int id = 1;
        List <TimetableHomework> temptemp = new ArrayList<TimetableHomework>();
        for (int i=0;i<5;i++) {  //Iteareate through each list
            for (int j=0;j<8;j++) {
                Stundatoflur_NK stundatofluRecord = (stundatofluDagar.get(i).get(j));
                TimetableHomework temp = new TimetableHomework(id,stundatofluRecord.getDagur(), stundatofluRecord.getHopur_id(), stundatofluRecord.getTimeslot(), stundatofluRecord.getStofa(), stundatofluRecord.getKennari_upphafsstafir(), stundatofluRecord.getAfangi_id(), stundatofluRecord.getNamsgrein_afanganr(),(HeimavinnaDagar.get(i).get(j)).getTexti());
                temptemp.add(temp);
                id++;
            }
        }
        return temptemp;
    }

}
